package com.hopes.bizz.poll.alarm.bo;

import com.hopes.bizz.poll.common.constant.enums.PollModDictEnum;
import com.hopes.bizz.poll.common.loigc.AlarmLogic;
import com.hopes.boss.admin.api.resolver.DictResolver;
import lombok.Data;

/**
 * @author daijie
 * @version 1.0
 * @date 2023/5/30 15:43
 * @Description: 报警因子数据统计
 */
@Data
public class AlarmFactorStatistics {
    /**
     * 报警因子编码
     */
    private String factorCode;
    /**
     * 报警因子名称
     */
    private String factorName;
    /**
     * 报警次数
     */
    private Integer num;
    /**
     * 报警时长
     */
    private Long time;

    public String getTimeDesc() {
        return AlarmLogic.buildDurationTimeDesc( this.time * 60);
    }

    public String getNumStr() {
        return num + "次";
    }

    public String getFactorCodeStr() {
        return DictResolver.getItemLabelByValue(PollModDictEnum.factor_info_code, this.factorCode);
    }
}
